<template>
    <div class="shis">
        <ul class="cityNames">
            
                <li  v-for="(item,index) of options" :key="index" @click="toThisCounty(item.Country)">
                    <span >{{item.Country}}</span>
                    <!-- <span class="iconfont"> &#xe74e;</span> -->
                </li>
            
        </ul>
    </div>
</template>

<script>
export default {
    name: "CommonSelecty",
    computed:{
        options(){
            var arr = this.$store.state.county;
            console.log(typeof(arr));
            for(var i=0;i<arr.length;i++){
                if(arr[i].Country=="城区"){
                    arr.splice(i,1);
                }
                if(arr[i].Country=="杭州"){
                    arr.splice(i,1);
                }
            }
            return arr;
        }
    },
    methods:{  
        toThisCounty(name){
            //this.$comjs.onCenter(120.155161,30.236581,800000.0)//定位到该城市。
            this.$store.commit('changeCountyName', name);
            if(this.$store.state.forq==0){
                localStorage.setItem('headerCounty', name);
                //this.$router.push('/county/' + name);
                window.location.href= "http://" + window.location.host + '/county/' + name;
            }else if(this.$store.state.forq==1){
                localStorage.setItem('headerCounty', name);
                //this.$router.push('/countyW/' + name);
                window.location.href= "http://" + window.location.host + '/countyW/' + name;
            }
            
        },
    }
}
</script>

<style lang="stylus" scoped>
    .shis
        min-height:18.9vh
        position:absolute
        left:185px
        top:55px
        z-index:100
        cursor : pointer
        display : flex
        ul
            width:135px
            background: rgba(31,39,49,0.9)
            border:1px solid #7d7d7d   
            padding-top:5px
            padding-bottom:5px 
            li
                font-size: 14px
                color: white
                height: 25px
                line-height: 25px
                text-indent: 5px
                span 
                    display: inline-block
                    height: 25px
                    line-height: 25px
                span.iconfont
                    float: right
                    padding-right: 5px
            li:hover
                background:#2FDEFD
                color: black
        .cityNames
            background: rgba(31,39,49,0.9)
            min-height:18.9vh
        .countyNames
            background: rgba(31,39,49,0.9)
            min-height:18.9vh
        .stationNames
            background: rgba(31,39,49,0.9)
            min-height:18.9vh
</style>

